#include<stdio.h>


struct class{
  int typePrim;// 0-> int, 1-> float, 2->bool, 3->String, >3 class  
  struct table *vars;
  struct table *methodes;
  struct node *mere;
};


struct function{
  int nbargs;
  struct node *typeretour;
  struct node **typeargs;
};




struct var{
  struct node *type;
};


struct node{
  int code; //0-> var, 1->fct, 2->class
  char *id;
  void *content;
  struct node *next;
};


struct table{
  struct node *head;
  struct node *tail;
};





void init_table(struct table *);
int isEmpty(struct table *);
void ajouter_noeud(struct node *,struct table *);
void vider_table(struct table *);
struct node * find_node(char *, struct table *);
struct node* initialize_noeud(int code, char *id, void *content);
void add_var(char *id, char *type, struct table *t_symb, struct table *t_type, char *class);
void add_function(char *id, int nbargs, char *typeargs[], char *typeret, char *class, struct table *t_type, struct table *t_symb);
void add_class(char *id, struct table *t_type, int typePrim, char *mere);
void debug_symb(struct table *t);
void debug_type(struct table *t);
int check_type(char *id, char *type, struct table *t);
char *return_type(char *id, struct table *t);

int check_object_calling(char *id, char *fct, struct table *t, int nbargs, char *typeargs[]);
int check_function_call(char *id, int nbargs, char *typeargs[], struct table *t);
